<template>
	<view class="backgroundhead">
		<view class="fonthead">
			<text>登录</text>
		</view>
		<view class="box">

			<view class="logo">
				<img src="../img/dllogo.png" class="logo">
			</view>
        
			<view class="input">
				<uni-easyinput v-model="user.email" placeholder="请输入邮箱号" maxlength=20></uni-easyinput>
			</view>
			<view class="input">
				<uni-easyinput type="password" v-model="user.passWord" placeholder="请输入密码"></uni-easyinput>
			</view>
			<view class="buttonexit">
				<button class="button-yuanjiao" hover-class="bg-click" @click="log()">登录</button>
			</view>
			<view class="buttonexit">
				<button class="button-yuanjiao2" hover-class="bg-click" @click="zhuce">注册</button>
			</view>
		</view>
    
	</view>
</template>

<script>
	export default {
		data() {
			return {
				user: {
					email: '',
					passWord: '',
					userid: 0
				}
			}
		},
		onLoad() {

		},
		methods: {
			zhuce(){
				uni.navigateTo({
				    url: '../gwb/Zhuce',
				    success: function(res) {              
				    }
				})
			},
			 log() {
				 this.$axios({
				 	url: 'serverwg/WjxLogin',
				 	data: this.user,
				 	method: 'POST',
				 	success: (res) => {
						uni.setStorageSync('user',res.data.data.user)
						if(res.data.data.user!=null){
							uni.navigateTo({
							    url: '../gwb/index',
							    success: function(res) {
							    }
							})
						}else{
							alert("邮箱/密码错误")
						}
						
				 	}
				 })
			 }
		}
	}
</script>

<style>
	.button-yuanjiao {
		width: 550rpx;
		height: 80rpx;
		display: flex;
		line-height: 50rpx;
		justify-content: center;
		border-radius: 25px;
		// 这里可以改成渐变： 
		background: linear-gradient(to right, #2ECC71, #2ABA66);
		/* background-color: #ED5565; */
		font-size: 17px;
		color: #FFFFFF;
		margin-top: 120px;
		padding: 7px;
		// font-family:STCaiyun;
	}

	.button-yuanjiao2 {
		width: 550rpx;
		height: 80rpx;
		display: flex;
		line-height: 50rpx;
		justify-content: center;
		border-radius: 25px;
		/* // 这里可以改成渐变： 
		background: linear-gradient(to right, #2ECC71, #2ABA66); */
		background-color: #FFFFFF;
		font-size: 17px;
		color: #2ECC71;
		margin-top: 30px;
		padding: 7px;
		border: 1px solid #2ECC71;

	}

	.buttonexit {
		/* margin-top: rpx; */
		/* border: 5px solid #3F536E; */
		/* 	margin-left: 10rpx; */
		float: left;
	}

	.input {
		margin-top: 50rpx;
	}

	.logo {
		width: 415rpx;
		height: 250rpx;
		/* 	border: 1px solid #3F536E; */
		margin: 20rpx auto;
	}

	.box {
		width: 600rpx;
		height: 1000rpx;
		border-radius: 7px;
		border: 1px solid #3F536E;
		padding: 10px;
		margin: 100rpx 50rpx auto;
		box-shadow: darkgrey 3px 3px 3px 3px;
		/* // position: absolute;
		// left: 25rpx; */
		background-color: #FFFFFF;
		float: left;

	}

	.fonthead {
		color: #000;
		font-size: 50rpx;
		margin-top: 100rpx;
		margin-left: 70rpx;
		float: left;
	}

	.backgroundhead {
		/* background-image: url('../img/xia.png'); */
		width: 100%;
		height: 234px;
		// font-family:Microsoft YaHei;

	}

	page {
		background-color: #EBFCF9;
		font-weight: bold;
	}
</style>